Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support expr when use typescript_custom_section attribute #3901

Merged
merged 21 commits into from
Apr 10, 2024

Conversation

swnb
Copy link
Contributor

@swnb swnb commented Mar 20, 2024

for example

#[wasm_bindgen(typescript_custom_section)]
const _: &'static str = include_str!("./types.d.ts");
const TS_INTERFACE_EXPORT: &str = "interface Person2 { height: number; }";
#[wasm_bindgen(typescript_custom_section)]
const _: &str = TS_INTERFACE_EXPORT;

this pr is inspired by #3308 , and will fix [#2828]

this pr is compatible with current encode logic, so wasm-bindgen cli can decode normally without updating

@daxpedda daxpedda added the needs review Needs a review by a maintainer. label Mar 27, 2024
@swnb
Copy link
Contributor Author

swnb commented Apr 1, 2024

I don't mean to rush you , but any progress about this pr @daxpedda

@daxpedda
Copy link
Collaborator

daxpedda commented Apr 1, 2024

Unfortunately I'm not really qualified to review any TS related stuff, so I leave it to other maintainers.

src/lib.rs Outdated Show resolved Hide resolved
crates/backend/src/codegen.rs Outdated Show resolved Hide resolved
crates/backend/src/codegen.rs Outdated Show resolved Hide resolved
crates/backend/src/codegen.rs Outdated Show resolved Hide resolved
crates/backend/src/codegen.rs Outdated Show resolved Hide resolved
crates/cli-support/src/decode.rs Outdated Show resolved Hide resolved
crates/shared/src/lib.rs Outdated Show resolved Hide resolved
crates/backend/src/encode.rs Outdated Show resolved Hide resolved
crates/typescript-tests/src/custom_section_types Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@swnb swnb requested a review from Liamolucko April 9, 2024 11:39
crates/backend/src/encode.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@swnb swnb requested a review from Liamolucko April 9, 2024 14:34
Copy link
Collaborator

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Could you add a changelog entry?

src/lib.rs Outdated Show resolved Hide resolved
Support Expressions when using the `typescript_custom_section` attribute[rustwasm#3901]
@swnb
Copy link
Contributor Author

swnb commented Apr 10, 2024

Thanks for your patience, I've updated the changelog

@swnb swnb requested a review from Liamolucko April 10, 2024 03:15
CHANGELOG.md Outdated Show resolved Hide resolved
@Liamolucko Liamolucko merged commit 7d0b11c into rustwasm:main Apr 10, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Needs a review by a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants